#pragma once
#include "Headers.h"
#include "EditorFrameListener.h"
#include "EditorResourceGroupListener.h"


namespace OgreUnified{

	class OgreInterface: Ogre::Singleton<OgreInterface>
	{
	private:
		Root*			mRoot;
		RenderSystem*	mRenderSystem;
		Ogre::String	mPluginsCfg, mConfigCfg, mLogCfg;
		Ogre::RaySceneQuery*	m_pray_scene_query;

	public:
		OgreInterface();
		~OgreInterface();
		bool Initialize();
		bool RestoreConfig();
		bool isInitialized();

		static OgreInterface* getSingletonPtr();
		static OgreInterface& getSingleton();


		void GetMeshInformation(Entity *entity,
                                size_t &vertex_count,
                                Ogre::Vector3* &vertices,
                                size_t &index_count,
                                unsigned long* &indices,
                                const Ogre::Vector3 &position,
                                const Ogre::Quaternion &orient,
                                const Ogre::Vector3 &scale);

		void GetMeshInformation(const Ogre::MeshPtr mesh,
                                size_t &vertex_count,
                                Ogre::Vector3* &vertices,
                                size_t &index_count,
                                unsigned long* &indices,
                                const Ogre::Vector3 &position,
                                const Ogre::Quaternion &orient,
                                const Ogre::Vector3 &scale);

		bool RaycastFromPoint(	RaySceneQuery* m_pray_scene_query,
								const Vector3 &point,
								const Vector3 &normal,
								Vector3 &result,
								Entity& entity);
	};
}